package com.syg.config;

import com.syg.task.RefreshRouteConfigTask;
import com.syg.task.RefreshRouteConfigTimer;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

// @Configuration
public class RefreshRouteConfiguration {

    @Resource
    private RefreshRouteConfigTask refreshRouteConfigTask;

    /**
     * 启动定时任务
     * @author syg
     */
    @PostConstruct
    public void doInit() {
        RefreshRouteConfigTimer timer=new RefreshRouteConfigTimer();
        timer.schedule(refreshRouteConfigTask, 1000 * 60, 1000*60*2);
    }
}
